using Os.Domain;
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Security;
namespace Os.WebUI.Controllers
{
	[HandleError]
	public class HomeController : Controller
	{
		[HttpGet, Authorize(Roles = "Administrador,Cliente")]
		public ActionResult Index()
		{
            ViewData["Titulo"] = "Bem Vindo!!! ";

			if (Roles.IsUserInRole("Administrador"))
			{
                return RedirectToAction("OrdensServicoPendentes","OrdemServico");	
			}
            else if (Roles.IsUserInRole("Cliente"))
            {
                return RedirectToAction("MinhasOrdensServico","OrdemServico");
            }
            else
            {
                return View();
            }
		}
	}
}